Skip navigation links

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle® Loader for Hadoop Java API Reference for Linux Release 2.1 E37150-02
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.hadoop.loader.examples
Class CSVInputFormat.CSVRecordReader

`java.lang.Object
<any>
oracle.hadoop.loader.examples.CSVInputFormat.CSVRecordReader`

Enclosing class:
  CSVInputFormat

      public static class CSVInputFormat.CSVRecordReader

extends <any>

The record reader parses the input data into key/value pairs which are read by `OraLoaderMapper`. It produces an `Object` for the key and a `org.apache.avro.generic.IndexedRecord` for the value.

Constructor Summary
`CSVInputFormat.CSVRecordReader(<any> textRecordReader)`

Method Summary
`void` | `close()` Close the record reader.
`java.lang.Object` | `getCurrentKey()` The key should be be an Object whose toString() method return value must help identify the `IndexedRecord` returned by `getCurrentValue()`.
`org.apache.avro.generic.IndexedRecord` | `getCurrentValue()` The next line of text is read from the input and split into tokens using the ',' delimiter.
`float` | `getProgress()` The current progress of the record reader through its data.
`void` | `initialize(InputSplit split, TaskAttemptContext context)` Called once at initialization.
`boolean` | `nextKeyValue()` Read the next key, value pair.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CSVInputFormat.CSVRecordReader

    public CSVInputFormat.CSVRecordReader(<any> textRecordReader)

Method Detail

### getCurrentValue

    public org.apache.avro.generic.IndexedRecord getCurrentValue()
                                                          throws java.io.IOException,
                                                                 java.lang.InterruptedException

  The next line of text is read from the input and split into tokens using the ',' delimiter. Token values are put into an Avro `IndexedRecord` which is returned as the key value.
  Returns:
    the current value or null if there is no current value
  Throws:
    `java.io.IOException`
    `java.lang.InterruptedException`

### getCurrentKey

    public java.lang.Object getCurrentKey()
                                   throws java.io.IOException,
                                          java.lang.InterruptedException

  The key should be be an Object whose toString() method return value must help identify the `IndexedRecord` returned by `getCurrentValue()`.

  This implementation returns the actual `Text` object that `getCurrentValue()` tokenizes into an `IndexedRecord`.

  Throws:
    `java.io.IOException`
    `java.lang.InterruptedException`

### initialize

    public void initialize(InputSplit split,
                           TaskAttemptContext context)
                    throws java.io.IOException,
                           java.lang.InterruptedException

  Called once at initialization.
  Parameters:
    `split` - the split that defines the range of records to read
    `context` - the information about the task
  Throws:
    `java.io.IOException`
    `java.lang.InterruptedException`

### close

    public void close()
               throws java.io.IOException

  Close the record reader.
  Throws:
    `java.io.IOException`

### nextKeyValue

    public boolean nextKeyValue()
                         throws java.io.IOException,
                                java.lang.InterruptedException

  Read the next key, value pair.
  Returns:
    true if a key/value pair was read
  Throws:
    `java.io.IOException`
    `java.lang.InterruptedException`

### getProgress

    public float getProgress()
                      throws java.io.IOException,
                             java.lang.InterruptedException

  The current progress of the record reader through its data.
  Returns:
    a number between 0.0 and 1.0 that is the fraction of the data read
  Throws:
    `java.io.IOException`
    `java.lang.InterruptedException`

Skip navigation links

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle® Loader for Hadoop Java API Reference for Linux Release 2.1 E37150-02
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2011, 2013, Oracle and/or its affiliates. All rights reserved.